package com.geeguo.ebuilder.client.base.core.dictionary;

import com.geeguo.ebuilder.core.common.dictionary.IDictionary;

import java.util.Arrays;
import java.util.List;

public enum CertificateTypeEnum implements IDictionary {

	Username(1, "用户名"),
	IdentificationNo(2, "证件号码"),
	Mobile(3, "移动电话"),
	Email(4, "电子邮件");

    private int    value;
    private String label;

    CertificateTypeEnum(int value, String label) {
        this.value = value;
        this.label = label;
    }

    @Override
    public int getValue() {
        return value;
    }

    @Override
    public String getLabel() {
        return label;
    }

    public static List<CertificateTypeEnum> getEnumValues() {
        return Arrays.asList(values());
    }

    public static CertificateTypeEnum parse(int value) {
        for (CertificateTypeEnum item : CertificateTypeEnum.values()) {
            if (value == item.getValue()) {
                return item;
            }
        }
        return null;
    }
}